package com.roin.learn.activiti.dao;

import com.roin.learn.activiti.base.BaseMapper;
import com.roin.learn.activiti.entity.User;
import com.roin.learn.activiti.entity.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface UserMapper extends BaseMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    /*************非自动生成方法***************/

    List<User> selectByExampleWithMc(UserExample example);
    User selectByUserId(@Param("userId")String userId);

    /**
     * 删除到Activiti用户表中业务用户表里没有的用户
     * @return
     */
    int delActivitiUserNotInUserTable();

    /**
     * 更新Activiti用户表中与业务用户表信息不一致的用户
     * @return
     */
    int updateActivitiUserfromUserTable();

    /**
     * 将Activiti用户表中没有的业务用户插入到Activiti用户表中
     * @return
     */
    int insertActivitiUserfromUserTable();

    List<org.activiti.engine.identity.User> selectUserNotInGroup(String groupId);
}